home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / util / libs / DigNet.lha / dignet / developer / includes / modula / dignet.def next >
Encoding:
Modula Definition  |  1997-07-15  |  5.6 KB  |  172 lines

  1. DEFINITION MODULE dignet;
  2.  
  3. (*$ Implementation- *)
  4.  
  5. (*
  6.  *   dignet.library include
  7.  *
  8.  *   Copyright © 1997 by Kenneth "Kenny" Nilsen/Digital Surface
  9.  *
  10.  *   $VER: DIGNET_MOD 1.3 (14.7.97)
  11.  *
  12.  *)
  13.  
  14. (*
  15.  * Cyclone Modula-2 include by Ernest J Gainey III (wavy@cyberservices.com)
  16.  *)
  17.  
  18. IMPORT ED:ExecD;
  19. IMPORT DOSD:DosD;
  20. IMPORT S: SYSTEM;
  21.  
  22. TYPE STRPTR=POINTER TO ARRAY [0..255] OF CHAR;
  23.  
  24. (*
  25.  *  Error codes
  26.  *)
  27.  
  28. CONST DNETERROR_OK           =  0; (* everything is ok *)
  29. CONST DNETERROR_OVERFLOW     = -1; (* buffer overflow (your string buffer) *)
  30. CONST DNETERROR_WRONGNET     = -2; (* you tried to free wrong net structure *)
  31. CONST DNETERROR_TIMEOUT      = -3; (* timed out waiting to receivce chars *)
  32. CONST DNETERROR_POINTERERROR = -4; (* wrong pointer (null ptr.) *)
  33. CONST DNETERROR_OUTOFMEMORY  = -5; (* not enough memory (Send/ReceiveNet()) *)
  34. CONST DNETERROR_FILEERROR    = -6; (* file not found (Send/ReceiveNet()) *)
  35. CONST DNETERROR_PROTOCOL     = -7; (* protocol error (not a protocol?) *)
  36. CONST DNETERROR_ABORTED      = -8; (* protocol was aborted *)
  37. (*
  38.  *  IOEXT
  39.  *)
  40.  
  41. CONST DNIOEXT_SIZEOF         = 80; (* max size for IOEXT structure *)
  42.  
  43. (*
  44.  *  InitModem buffer size
  45.  *)
  46.  
  47. CONST INITMODEMBUFFER        = 16; (* minimum length of initmodem's buffer *)
  48.  
  49. (*
  50.  *  The public resource list structure
  51.  *)
  52.  
  53. TYPE DIGNETRT = RECORD
  54.      DNRT_ID: LONGCARD;            (* net ID *)
  55.      DNRT_NET: S.ADDRESS;          (* ptr. to netstructure *)
  56.      DNRT_TASK: S.ADDRESS;         (* ptr. to task structure using the net *)
  57.      DNRT_TASKNAME: STRPTR;        (* ptr. to task name of that task *)
  58.      DNRT_DEVICENAME: STRPTR;      (* ptr. to device name in use *)
  59.      DNRT_UNIT: CARDINAL;          (* unit number in use *)
  60.      DNRT_SP: S.ADDRESS;           (* Return address *)
  61.      DNRT_MESSAGEPORT: S.ADDRESS;  (* ptr. to message port of device *)
  62.      DNRT_MESSAGESTRUCT: S.ADDRESS;(* ptr. to IO message of device *)
  63.      DNRT_LASTCOMMAND: LONGCARD;   (* command number on last librarycall *)
  64.      DNRT_TASKSTATUS: INTEGER;     (* BOOL on the tasks existance (true=ok) *)
  65.      DNRT_reserved0: LONGCARD;     (* reserved for future extensions *)
  66.      DNRT_reserved1: LONGCARD;
  67.      DNRT_reserved2: LONGCARD;
  68.      DNRT_reserved3: LONGCARD;
  69.      DNRT_reserved4: LONGCARD;
  70. END;
  71.  
  72. CONST CMDALLOCNET           =  1;
  73. CONST CMDREADNET            =  2;
  74. CONST CMDWRITENET           =  3;
  75. CONST CMDQUERYNET           =  4;
  76. CONST CMDABORTNET           =  5;
  77. CONST CMDINITIOEXT          =  6;
  78. CONST CMDREADIOEXT          =  7;
  79. CONST CMDSENDNET            =  8;
  80. CONST CMDRECEIVENET         =  9;
  81. CONST CMDTIMEOUT            = 10;
  82. CONST CMDREADSTRING         = 11;
  83. CONST CMDWRITESTRING        = 12;
  84. CONST CMDGETNETPORT         = 13;
  85. CONST CMDINITMODEM          = 14;
  86. CONST CMDCALLMODEMDT        = 15;
  87. CONST CMDCALLMODEMDP        = 16;
  88. CONST CMDWAITMODEM          = 17;
  89. CONST CMDHANGUPMODEM        = 18;
  90. CONST CMDSTOPWAITING        = 19;
  91. CONST CMDFLUSHNET           = 20;
  92. CONST CMDSETBAUD            = 21;
  93. CONST CMDCONVERTMODEMSTRING = 22;
  94. CONST CMDGETIOMSG           = 23;
  95. CONST CMDGETMODEMSTATUS     = 24;
  96. CONST CMDGETCURRENTDEVICE   = 25;
  97. CONST CMDGETCURRENTUNIT     = 26;
  98. CONST CMDGETBAUDRATE        = 27;
  99. CONST CMDPARSECONNECT       = 28;
  100. CONST CMDSETDEFAULT         = 29;
  101. CONST CMDCONVERTTOPC        = 30;
  102. CONST CMDCONVERTTOAMIGA     = 31;
  103. CONST CMDFREECONVERT        = 32;
  104. CONST CMDOBTAINNET          = 33;
  105.  
  106. (* new from v4 *)
  107.  
  108. CONST CMDWAITTEXT         = 34;
  109. CONST CMDCONVERSETEXT     = 35;
  110. CONST CMDCAPTURETEXTSTART = 36;
  111. CONST CMDCAPTURETEXTEND   = 37;
  112. CONST CMDSETPARITY        = 38;
  113. CONST CMDSETHANDSHAKE     = 39;
  114. CONST CMDSETSTOPBITS      = 40;
  115. CONST CMDSETBITWIDTH      = 41;
  116. CONST CMDGETPARITY        = 42;
  117. CONST CMDGETHANDSHAKE     = 43;
  118. CONST CMDGETSTOPBITS      = 44;
  119. CONST CMDGETBITWIDTH      = 45;
  120.  
  121. (*
  122.  * New from 3.1
  123.  * Update structure for the Dignet protocol
  124.  *)
  125.  
  126. TYPE DIGNETUPDATE = RECORD
  127.      DNU_FILENAME : ARRAY [0..107] OF CHAR; (* name of file without path *)
  128.      DNU_FILESIZE : LONGCARD;               (* size of file in bytes *)
  129.      DNU_RATE     : LONGCARD;               (* transfer rate bytes/s *)
  130.      DNU_EXPECTED : DOSD.Date;              (* expected time on transfer *)
  131.      DNU_USED     : DOSD.Date;              (* time used on transfer *)
  132.      DNU_STATUS   : CARDINAL;               (* status flags *)
  133.      DNU_HOOK     : LONGINT;                (* hook to be called after each 
  134.                                                block transfer *)
  135. END;
  136.  
  137. CONST DNUSTATUS_OK        =  0; (* everthing is ok *)
  138. CONST DNUSTATUS_ERROR     =  1; (* transfer had an error *)
  139. CONST DNUSTATUS_RESENDING =  2; (* resending block/file *)
  140. CONST DNUSTATUS_WAITING   =  4; (* waiting to receive/send file *)
  141. CONST DNUSTATUS_ABORT     =  8; (* was aborted, if you set this flag
  142.                                   protocol will be aborted *)
  143. CONST DNUSTATUS_END       = 16; (* end of file (done) *)
  144.  
  145. (*
  146. To let user abort a protocol transfer you need to create a subtask that will
  147. check for user input such as keypress/mousebutton/gadget etc. If user want to
  148. abort transfer you must set the _abort flag. The other end of the protocol
  149. will read  this as user abort and end. If not this flag can be interacted the
  150. protocol will not stop until the whole file is transfered/resent error free.
  151. *)
  152.  
  153. (* CaptureTextStart modes: *)
  154.  
  155. CONST DNCAPTURENEW    =  0;
  156. CONST DNCAPTUREAPPEND = -1;
  157.  
  158. (* Modes for SetParity *)
  159.  
  160. CONST DNPARITYNONE  = 0;
  161. CONST DNPARITYEVEN  = 1;
  162. CONST DNPARITYODD   = 2;
  163. CONST DNPARITYMARK  = 3;
  164. CONST DNPARITYSPACE = 4;
  165.  
  166. (* MODES FOR SETHANDSHAKE *)
  167.  
  168. CONST DNHANDSHAKENONE  = 0;
  169. CONST DNHANDSHAKE7WIRE = 1; (* RTS/CTS  *)
  170. CONST DNHANDSHAKEX     = 2; (* XON/XOFF *)
  171.  
  172. END dignet.